Properly redirect to /agents after creating a new agent

Akinori MUSHA %!s(int64=9) %!d(string=hace) años
padre
commit
e3f090ade8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      app/controllers/agents_controller.rb

+ 1 - 1
app/controllers/agents_controller.rb

@@ -160,7 +160,7 @@ class AgentsController < ApplicationController
160 160
 
161 161
     respond_to do |format|
162 162
       if @agent.save
163
-        format.html { redirect_back "'#{@agent.name}' was successfully created." }
163
+        format.html { redirect_back "'#{@agent.name}' was successfully created.", return: agents_path }
164 164
         format.json { render json: @agent, status: :ok, location: agent_path(@agent) }
165 165
       else
166 166
         initialize_presenter